package org.example.sy5.mapper;

import lombok.Data;
import org.apache.ibatis.annotations.*;
import org.example.sy5.entity.CustEntity;

import java.util.List;

@Mapper
public interface CustMapper {
    @Select("select * from tb_cust")
    List<CustEntity> getall();
    @Insert("insert into tb_cust(cname,cbirth,cfavs,csex,ctel,caddr) values(#{cname},#{cbirth},#{cfavs},#{csex},#{ctel},#{caddr})")
    void add(CustEntity custEntity);
    @Delete("delete from tb_cust where id=#{id}")
    void del(int id);
    @Update("update tb_cust set cname=#{cname},cbirth=#{cbirth},cfavs=#{cfavs},csex=#{csex},ctel=#{ctel},caddr=#{caddr} where id=#{id}")
    void upd(CustEntity custEntity);
}
